using AvaloniaMaid2022.Helpers;
using EnvDTE;
using Microsoft.VisualStudio.TemplateWizard;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace AvaloniaMaid2022.Wizards
{
    public class UserControlWizard : IWizard
    {
      

        public void BeforeOpeningFile(ProjectItem projectItem)
        {
        }

        public void ProjectFinishedGenerating(Project project)
        {
        }

        public void ProjectItemFinishedGenerating(ProjectItem projectItem)
        {
        }

        public void RunFinished()
        {
        }

        public void RunStarted(object automationObject, Dictionary<string, string> replacementsDictionary,
            WizardRunKind runKind, object[] customParams)
        {
            try
            {
                var rootnamespace = replacementsDictionary["$rootnamespace$"];
                var rootnamespaceshortname = NamespaceHelper.GetNamespaceShortName(rootnamespace);
                // Add custom parameters.
                replacementsDictionary.Add("$rootnamespaceshortname$", rootnamespaceshortname);
            }
            catch (WizardCancelledException)
            {
              
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }

        }

        public bool ShouldAddProjectItem(string filePath)
        {
            return true;
        }
    }
}
